from django.db import models
from django.contrib.auth.models import User
 
class UserProfile(models.Model):
    user = models.OneToOneField(User)
    #activation_key = models.CharField(max_length = 32)
    #key_expires = models.DateTimeField()
    def __unicode__(self):
        return self.name
    
class EventProfile(models.Model):
    eventStartDate = models.CharField(max_length = 32)
    eventEndDate = models.CharField(max_length = 32)
    eventName = models.CharField(max_length=75)
    
    
    def __unicode__(self):
        return self.eventName

    
class EventExpenseProfile(models.Model):
    expenseName = models.CharField(max_length = 32)
    expenseAmount = models.FloatField()
    expenseDate = models.DateField()
    expenseAddedDate = models.DateTimeField()
    expenseOwner = models.ForeignKey(UserProfile)
    expenseEvent = models.ForeignKey(EventProfile, blank = True, null = True)
    
    def __unicode__(self):
        return self.expenseName
    
class PersonOnEvent(models.Model):
    user = models.OneToOneField(User)
    Event = models.ForeignKey(EventProfile)
    
class ProportionalDate(models.Model):
    date = models.DateField()
    prop = models.FloatField()
    personOnEvent = models.ForeignKey(PersonOnEvent)
    


    
        

    

     